home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness: Critical Thinking Skills / Workplace Effectiveness: Critical Thinking Skills.iso / pc / Files / Sleuth.dxr / 00008_sprite handlers.ls < prev    next >
Encoding:
Text File  |  1998-09-14  |  2.6 KB  |  103 lines

  1. global gHandCursor, gHandMask, gFingerCursor, gFingerMask
  2.  
  3. on clickButton action
  4.   set spriteNum to the clickOn
  5.   set castMember to the member of sprite spriteNum
  6.   set Castname to the name of member castMember
  7.   set castNum to the castLibNum of member castMember
  8.   puppetSprite(spriteNum, 1)
  9.   repeat while the mouseDown
  10.     if rollOver(spriteNum) then
  11.       set the member of sprite spriteNum to member (Castname && "dn") of castLib castNum
  12.       updateStage()
  13.       next repeat
  14.     end if
  15.     set the member of sprite spriteNum to castMember
  16.     updateStage()
  17.   end repeat
  18.   set the member of sprite spriteNum to castMember
  19.   updateStage()
  20.   puppetSprite(spriteNum, 0)
  21.   if rollOver(spriteNum) then
  22.     do(action)
  23.   end if
  24. end
  25.  
  26. on clickButton3 thisSprite, artName
  27.   set castMember to the member of sprite thisSprite
  28.   set Castname to the name of member castMember
  29.   set castNum to the castLibNum of member castMember
  30.   puppetSprite(thisSprite, 1)
  31.   repeat while the mouseDown
  32.     if rollOver(thisSprite) then
  33.       set the member of sprite thisSprite to member (artName && "dn") of castLib castNum
  34.       updateStage()
  35.       next repeat
  36.     end if
  37.     exit repeat
  38.   end repeat
  39.   set the member of sprite thisSprite to member (artName && "on")
  40. end
  41.  
  42. on setPuppetState channelList, type, state
  43.   if type = #c then
  44.     repeat with n = getAt(channelList, 1) to getAt(channelList, 2)
  45.       puppetSprite(n, state)
  46.     end repeat
  47.   else
  48.     repeat with n in channelList
  49.       puppetSprite(n, state)
  50.     end repeat
  51.   end if
  52. end
  53.  
  54. on setVisibleState channelList, type, state
  55.   if type = #c then
  56.     repeat with n = getAt(channelList, 1) to getAt(channelList, 2)
  57.       set the visible of sprite n to state
  58.     end repeat
  59.   else
  60.     repeat with n in channelList
  61.       set the visible of sprite n to state
  62.     end repeat
  63.   end if
  64. end
  65.  
  66. on setMoveableState channelList, type, state
  67.   if type = #c then
  68.     repeat with n = getAt(channelList, 1) to getAt(channelList, 2)
  69.       set the moveableSprite of sprite n to state
  70.     end repeat
  71.   else
  72.     repeat with n in channelList
  73.       set the moveableSprite of sprite n to state
  74.     end repeat
  75.   end if
  76. end
  77.  
  78. on setHandCursor cState, handList
  79.   case cState of
  80.     #on:
  81.       repeat with x in handList
  82.         set the cursor of sprite x to gHandCursor
  83.       end repeat
  84.     #off:
  85.       repeat with x in handList
  86.         set the cursor of sprite x to 0
  87.       end repeat
  88.   end case
  89. end
  90.  
  91. on setFingerCursor cState, fingerList
  92.   case cState of
  93.     #on:
  94.       repeat with x in fingerList
  95.         set the cursor of sprite x to gFingerCursor
  96.       end repeat
  97.     #off:
  98.       repeat with x in fingerList
  99.         set the cursor of sprite x to 0
  100.       end repeat
  101.   end case
  102. end
  103.